package com.lyz.dataStructure.xiancheng.线程池;/**
 * @Author:759057893@qq.com Lyz
 * @Date: ${Date} 20:45
 * @Description:
 **/

import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

/**
 *@Author:759057893@qq.com Lyz
 *@Date: 2019/7/4 20:45
 *@Description:
 **/
public class ScheduledThreadPoolDemo  {
    public static void main(String[] args) {
        ScheduledExecutorService scheduledThreadPool = Executors.newScheduledThreadPool(5);
        scheduledThreadPool.schedule(new Runnable() {

            @Override
            public void run() {
                System.out.println("delay 3 seconds");
            }
        }, 3, TimeUnit.SECONDS);
    }

}
